package com.ub.party.web.controller;

import com.ub.party.common.vo.resp.RespVo;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by Hanran on 2018-01-11.
 */
@Controller
public class StudioController {

  /**
   * 活动模板列表
   *
   * @param model
   * @param request
   * @return
   */
  @RequestMapping(value = "/Studio/templateList", method = RequestMethod.GET)
  public String templateList(Model model, HttpServletRequest request) {
//        model.addAttribute("homePath", applicationPropertyConfig.getHomePath());
    return "mgt/template";
  }

  @RequestMapping(value = "/Studio/templateDetail", method = RequestMethod.GET)
  public String templateDetailHtml(Model model, HttpServletRequest request, @RequestParam("id") String id) {
//        model.addAttribute("homePath", applicationPropertyConfig.getHomePath());
    return "mgt/templateDetail";
  }

  @ResponseBody
  @RequestMapping(value = "/Studio/templateDetail", method = RequestMethod.POST)
  public RespVo templateDetailContent(Model model, HttpServletRequest request, @RequestParam("id") String id) {
//        model.addAttribute("homePath", applicationPropertyConfig.getHomePath());
    return RespVo.ok();
  }

  @RequestMapping(value = "/Studio/index", method = RequestMethod.GET)
  public String editStudio(Model model, HttpServletRequest request, @RequestParam(value = "tId", required = false) String tId,
                           @RequestParam(value = "id", required = false) String id) {
//        model.addAttribute("homePath", applicationPropertyConfig.getHomePath());
    return "mgt/activityEdit";
  }
}
